package com.ts.animal.controller;

import java.util.List;
import java.util.Map;

import com.ts.common.utils.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ts.animal.domain.RfidLabelUseInfoDO;
import com.ts.animal.service.RfidLabelUseInfoService;
import com.ts.common.service.ExportExcelSevice;

/**
 * 标签使用状态表
 *
 * @author bobby
 * @email bobby@126.com
 * @date 2023-01-04 17:15:32
 */

@Controller
@RequestMapping("/animal/rfidLabelUseInfo")
public class RfidLabelUseInfoController {
	@Autowired
	private RfidLabelUseInfoService rfidLabelUseInfoService;

	@GetMapping()
	@RequiresPermissions("animal:rfidLabelUseInfo:rfidLabelUseInfo")
	String RfidLabelUseInfo(){
	    return "animal/rfidLabelUseInfo/rfidLabelUseInfo";
	}

	@ResponseBody
	@RequestMapping("/list")
	@RequiresPermissions("animal:rfidLabelUseInfo:rfidLabelUseInfo")
	public PageUtils list(@RequestParam Map<String, Object> params){
		//查询列表数据
		PageUtils pageUtils = new PageInfos(params) {
			public List inject(Map params) {
				return rfidLabelUseInfoService.list(params);
			}
		}.query().lowerUnderscore();
		return pageUtils;
	}

	/**
	 * 批量删除
	 */
	@PostMapping( "/batchRemove")
	@ResponseBody
	@RequiresPermissions("animal:rfidLabelUseInfo:batchRemove")
	public Result remove(@RequestParam("ids[]") String[] nums){
		Result result = Result.ok();
		rfidLabelUseInfoService.batchRemove(result,nums);
		return result;
	}

}
